<?php
/*
**2015-07-10 16:16鼓浪屿轮渡预订页面获取航班余票
**user by pzp
*/
include('/var/www/html/new/d/module/api/glyld/glyld.class.php');
$gly = new Ferry_gly();
$ids = explode('_',$_REQUEST['hlineid']);
$hlineid = $ids[0];
$sdate = str_replace('-','',$_REQUEST['sdate']);
$getDailyFlight = $gly->getDailyFlight($hlineid,$sdate);
$select_count_xml  = simplexml_load_string($getDailyFlight);
if((int)$select_count_xml->code == 0){
	$status='success';
	$list = array();
	$list2 = array();
	if($select_count_xml->content->list->DailyFlight){
		foreach($select_count_xml->content->list->DailyFlight as $list3){
			$list['dailyFlightGid'] = (string)$list3->dailyFlightGid;
			$list['departTime']  = (string)$list3->departTime;
			$list['offLineFreeCount']= (string)$list3->offLineFreeCount;
			$list2[] = $list;
		}
	}
}else{
	$status='fail';
	$return_array['list'] =null;
}
$return_array['status'] = $status;
$return_array['list'] = $list2;
echo json_encode($return_array);
?>